<?php
/**
* @package controller
* @file indexController.php
* @date 15.09.2009
* @version 1.0
* @copyright sample
* @author Harinath Reddy
* @todo phpDoc comments
*/
require_once 'Zend/Controller/Action.php';

class triggers_MyactivityController extends Cms_Controller_Action
{
	public function init()
	{
	  $this->view->siteTitle = 'Triggers';
	  $this->currentPage = 1;
	  $this->resultsPerPage = 8;
			
	}
	public function indexAction() 
	{	
		//echo $analysis = $this->analysis();			
    }
	
	public function myactivityAction() 
	{	
		$memid = $_SESSION["sess_userid"];
		$result = Doctrine::getTable('EmActivities')->getMyActivities($memid,1,12);
		//echo '<pre>';print_r($result);exit;
		$this->view->tavva = 'TEST';
		$this->view->getActivities=$result;
		//$this->render('myactivity-list');
	}
	public function paginationAction()
	{
		$memid=$_SESSION["sess_userid"];
		$this->view->params ="";
		$type = $this->_getParam('id') == 0? 1:$this->_getParam('id');
		$serValue = $this->_getParam('orderby') == ''? '':$this->_getParam('orderby');
		//echo $type;exit;
		$currentPage = $this->_getParam('current_page') == 0? 1:$this->_getParam('current_page');
		$resultsPerPage = $this->_getParam('results_per_page') == 0? 12:$this->_getParam('results_per_page');
		//echo $resultsPerPage;exit;
		$getActivity = Doctrine::getTable('EmActivities')->getMyActivities($memid,$currentPage,$resultsPerPage);
		//echo '<pre>';print_r($getActivity);exit;
		$this->view->getActivities = $getActivity;
		$jsonData['output'] = $this->view->render('myactivity/myactivity-list.html');
		$jsonData['pages'] = $getActivity['pages'];
	    $jsonData['pager'] = $getActivity['pager'];
	    $jsonData['currentPage'] = $getActivity['currentPage'];
		$jsonData['resultsCount'] = $getActivity['resultsCount'];
		$this->_helper->json->sendJson($jsonData);
		//echo '<pre>';print_r($ideaDetails);exit;
		
	}

}	
